Recent advances in digital signal processing technology have made it possible to encode proficiently large amounts of digital information such as moving images as well as still images and audio, to record to compact recording media, to transfer by communication media, and so forth. Adapting this type of technology, development of moving image data encoding apparatuses that can convert television broadcasts and moving images recorded with a video camera into video streams is under way.
As encoding schemes for moving images, MPEG2 and H.264 (also known as AVC) standards are well known. In particular, the H.264 standard, by adopting interframe encoding that can reference to any given picture, achieves compression-encoding of moving images more proficiently than the MPEG2 standard.
However, with H.264, although it allow any given picture to be used as a reference picture, of all the pictures there may be those that are apparently unsuitable as reference pictures. If such pictures can be removed from consideration as references, encoding efficiency could be improved. Thus, for example, in JP-2006-115336-A, an approach is disclosed in which pictures taken with a flash are not used as reference pictures.
At the same time, in H.264, an encoding termination process is sometimes carried out. The following is a detailed description of such encoding termination process.
FIG. 4 is a diagram showing a state of a decoder buffer in which an encoded video stream is stored. When decoding the encoded video stream, in the decoder buffer, as time progresses, the encoded video stream is input at a predetermined rate. By contrast, each time the stream is decoded, an amount of encoded data of the picture that is to be decoded is removed from the decoder buffer. Thus, to ensure that the decoder buffer neither overflows nor underflows, the amount of data that is removed must be correctly controlled. To accomplish such control, the encoded amount of picture must be correctly controlled. For example, in FIG. 4, at a time T the amount of encoded data of picture must not exceed an encoded amount S.
As a means of correctly controlling the picture encoded amount, multi-pass coding, in which encoding of the picture is repeated several times, is used in the creation of video software commercially available for use with DVD players and the like. However, most apparatuses that require encoding in real time, such as a video camera when recording, typically use one-pass coding, in which encoding can only be carried out once. As a result, in a case in which an amount of generated code of a picture is greater than expected, it is necessary to increase the compression rate partway through the picture and keep the encoded amount within a predetermined amount. Specifically, high-frequency components of the video image are drastically cut, drastically reducing the amount of generated code. In the present specification, this process is called an encoding termination process or encoding termination processing.
FIG. 3 is a diagram showing an example of a screen in a case in which a termination process has been performed partway through a picture. FIG. 3 shows an example of decoding results in a case in which encoding is executed sequentially from the upper left of the picture and a termination process is performed roughly halfway through the screen. Although the upper half 301 of the screen is decoded correctly, the lower half 302 is decoded into a block-shaped video image.
If a picture that has been subjected to a termination process as described above is used as a reference picture and interframe prediction coding carried out based on such reference picture, because the correlation of the block-shaped video image portion with the corresponding portion of the picture is very low, compression efficiency decreases sharply and the amount of generated code increases, which is a problem.